package com.gongj.event;

import org.springframework.context.ApplicationListener;
import org.springframework.context.event.EventListener;
import org.springframework.core.annotation.Order;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
@Order(998)
//implements ApplicationListener<SendEvent>
public class SmsSendEventListener  {

//	@Override
//	public void onApplicationEvent(SendEvent event) {
//		try {
//			Thread.sleep(1000);
//		} catch (InterruptedException e) {
//			e.printStackTrace();
//		}
//		System.out.println("开始发送短信======》" + event.getUserInfo());
//	}
    @EventListener(classes = SendEvent.class)
	@Async
	public void sendEventListener(SendEvent event){
		System.out.println("开始发送短信======》" + event.getUserInfo());
	}

}
